<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link href="__STATIC__assets/images/favicon.ico" rel="icon">
    <title>{$data.name}后台管理中心</title>
    <link rel="stylesheet" href="__STATIC__assets/libs/layui/css/layui.css"/>
    <link rel="stylesheet" href="__STATIC__assets/module/admin.css?v=318"/>
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>
<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
    <!-- 头部 -->
    <div class="layui-header">
        <div class="layui-logo">
            <img src="__STATIC__assets/images/favicon.ico"/>
            <cite>&nbsp;{$data.name}</cite>
        </div>
        <ul class="layui-nav layui-layout-left">
            <li class="layui-nav-item" lay-unselect>
                <a ew-event="flexible" title="侧边伸缩"><i class="layui-icon layui-icon-shrink-right"></i></a>
            </li>
            <li class="layui-nav-item" lay-unselect>
                <a ew-event="refresh" title="刷新"><i class="layui-icon layui-icon-refresh-3"></i></a>
            </li>
            {if condition="$data.type eq '2'"}  
                
                    
           <li class="layui-nav-item layui-hide-xs layui-this" lay-unselect><a nav-bind="xt1">后台管理中心</a></li>
           <li class="layui-nav-item layui-hide-xs" lay-unselect><a nav-bind="xt2">收款商户管理</a></li>
                    <!-- 小屏幕下变为下拉形式 -->
                    <li class="layui-nav-item layui-hide-sm layui-show-xs-inline-block" lay-unselect>
                        <a>系统切换</a>
                        <dl class="layui-nav-child">
                            <dd lay-unselect><a nav-bind="xt1">后台管理中心</a></dd>
                            <dd lay-unselect><a nav-bind="xt2">收款商户管理</a></dd>
                    
                        </dl>
                    </li>
            {/if}
        </ul>
        <ul class="layui-nav layui-layout-right">
            <!--<li class="layui-nav-item" lay-unselect>
                <a ew-event="message" title="消息">
                    <i class="layui-icon layui-icon-notice"></i>
                    <span class="layui-badge-dot"></span>
                </a>
            </li>
            <li class="layui-nav-item" lay-unselect>
                <a ew-event="note" title="便签"><i class="layui-icon layui-icon-note"></i></a>
            </li>-->
            <li class="layui-nav-item layui-hide-xs" lay-unselect>
                <a ew-event="fullScreen" title="全屏"><i class="layui-icon layui-icon-screen-full"></i></a>
            </li>
            <li class="layui-nav-item layui-hide-xs" lay-unselect>
                <a ew-event="lockScreen" title="锁屏"><i class="layui-icon layui-icon-password"></i></a>
            </li>
            <li class="layui-nav-item" lay-unselect>
                <a>
                    <img src="{$data.qqtx}" class="layui-nav-img">
                    <cite>{$data.user}</cite>
                </a>
                <dl class="layui-nav-child">
                    <dd lay-unselect><a ew-event="psw">修改密码</a></dd>
                    <dd lay-unselect><a ew-event="logout" data-url="{:url('admin/logout')}">退出登录</a></dd>
                </dl>
            </li>
            <li class="layui-nav-item" lay-unselect>
                <a ew-event="theme" title="主题"><i class="layui-icon layui-icon-more-vertical"></i></a>
            </li>
        </ul>
    </div>

    <!-- 侧边栏 -->
    <div class="layui-side">
        <div class="layui-side-scroll">
            <div id="v_menu"></div>
        </div>
    </div>

    <!-- 主体部分 -->
    <div class="layui-body"></div>
    <!-- 底部 -->
    <div class="layui-footer layui-text">
        © 2021 {$data.web_name} <a href="http://beian.miit.gov.cn" target="_blank"> {$data.web_beian}</a>
        <span class="pull-right">未速码支付系统|版本{$data.ver}</span>
    </div>
</div>

<!-- 加载动画 -->
<div class="page-loading">
    <div class="ball-loader">
        <span></span><span></span><span></span><span></span>
    </div>
</div>

<!-- js部分 -->
<script type="text/javascript" src="__STATIC__assets/js/jquery@1.11.3.js"></script>
<script type="text/javascript" src="__STATIC__assets/libs/layui/layui.js"></script>
<script type="text/javascript" src="__STATIC__assets/js/common.js?v=318"></script>
<script>
$.post("getMenu",function (data) {
    layui.use(['index', 'form'], function () {
        var $ = layui.jquery;
        var index = layui.index;
        var form = layui.form;
        // 默认加载主页
        index.loadHome({
            menuPath: data[0].url,//主页路径
            menuName: '<i class="layui-icon '+data[0].i+'"></i>',//Tab标题
            loadSetting: false,//是否恢复记忆的Tab，默认为true
            onlyLast: false,//是否仅恢复最后一个Tab，默认为false
        });
    // 增加滚动文字
    $('.layui-body-header').addClass('text-center');
    $('.layui-body-header-title').addClass('pull-left').css({'line-height': 'initial', 'margin-top': '10px'})
    .after('<span>{$data.name}</span>');
    });
    console.log(data);
    var out_menu = "";
    for (var i = 0;i<data.length;i++){
        if (data[i].type=="nav"){
            out_menu+='<ul class="layui-nav layui-nav-tree '+data[i].name+'" nav-id="'+data[i].url+'" lay-filter="admin-side-nav" lay-shrink="_all" >';
                for (var ii = 0;ii<data[i].node.length;ii++){
                    if (data[i].node[ii].type=="url"){
                        out_menu+='<li class="layui-nav-item"><a lay-href="'+data[i].node[ii].url+'"><i class="layui-icon '+data[i].node[ii].i+'"></i>&emsp;<cite>'+data[i].node[ii].name+'</cite></a></li>';
                    } else if (data[i].node[ii].type=="menu"){
                        out_menu+='<li class="layui-nav-item layui-nav-itemed"><a><i class="layui-icon '+data[i].node[ii].i+'"></i>&emsp;<cite>'+data[i].node[ii].name+'</cite></a><dl class="layui-nav-child">';
                            for (var iii = 0;iii<data[i].node[ii].node.length;iii++){
                                out_menu+='<dd><a lay-href="'+data[i].node[ii].node[iii].url+'">'+data[i].node[ii].node[iii].name+'</a></dd>';
                            }
                        out_menu+='</dl></li>';
                    }
                }
            out_menu+='</ul>';    
        }
    }
    $("#v_menu").append(out_menu);
    if({$data.wuqhhdd}!='0'){
    layer.open({
        type: 1
        ,title: false //不显示标题栏
        ,closeBtn: false
        ,area: '400px;'
        ,shade: 0.8
        ,id: 'LAY_layuipro' //设定一个id，防止重复弹出
        ,btn: ['知道了']
        ,btnAlign: 'c'
        ,moveType: 1 //拖拽模式，0或者1
        ,content: '<div style="padding: 50px; line-height: 22px; background-color: #393D49; color: #fff; font-weight: 300;">{$data.tz_denglu|raw}</div>'
        ,success: function(layero){
          var btn = layero.find('.layui-layer-btn');
        }
      });
    }
});
layui.use(['form', 'notice'], function () {
    var $ = layui.jquery;
    var form = layui.form;
    var notice = layui.notice;
  function dsadq(title,message) {
    notice.show({
        image: 'https://ku.oioweb.cn/img/weimusic1.gif',
        imageWidth: 71,
        audio: '1',
        timeout: '2500',
        animateInside: true,
        displayMode: '1',
        position: 'bottomRight',
        maxWidth: '300px',
        title: title,
        maxWidth: '300px',
        message: message
    });
  }
  dsadsa = function () {
    $.post("dsadsa",function (res) {
        if(res.code == 1){
            dsadq("订单通知","叮咚，您有新订单等待支付中，请注意查收!");
        }else if(res.code == 2){
            dsadq("订单通知","叮咚，您有一个订单补单成功，请及时查看!");
        }else if(res.code == 3){
            dsadq("订单通知","叮咚，您有一个订单通知失败，请及时处理!");
        }else if(res.code == 4){
            dsadq("订单通知","叮咚，您有一个订单支付成功，请及时查看!");
        }
    });
 }
 //用户打开商户中心时候帮着监控
  crontabpay = function () {
  $.get('/pay/index/Cookie?r='+Math.random(1), function (result) {
      dsadsa();
      setTimeout(function(){crontabpay()}, 1000);
    }, 'json');
  }
  //crontabpay();//订单通知
});
</script>
</body>
</html>